package org.jeecg.modules.friends.enums;

/**
 * @author cold
 * @data 2024/5/27 11:27
 * @version 1.0
 */
public enum FriendsStatusEnum {
    UNKNOWN(0, "未知"),
    INIT(10, "初始化"),
    APPLY(20, "已申请"),

    REJECT(30, "已拒绝"),
    AGREE(40, "已同意"),
    FRIEND(50, "好友"),
    PASSED(60, "不想看"),

    ;
    private int code;
    private String desc;

    FriendsStatusEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static FriendsStatusEnum of(Integer status) {
        for (FriendsStatusEnum value : FriendsStatusEnum.values()) {
            if (value.getCode() == status) {
                return value;
            }
        }
        return UNKNOWN;
    }


    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}
